﻿<System.Serializable()> Public Class ImgControlItem

    Public Sub New()

    End Sub

    Public Sub New(ByVal apti As AiPortTypeItem, ByVal imageid As String, ByVal TipMsg As String)

        MyClass.New()

        _ProjectID = apti.ProjectID
        _Netid = apti.NetId
        _Refid = apti.RefId
        _PortNo = apti.PortNo
        _ImageID = imageid
        _DataType = apti.DataType
        _TitleMsg = apti.PortName & ":"
        _TipMsg = TipMsg
        If apti.DataType = 1 Then
            _UnitMsg = "℃"
        ElseIf apti.DataType = 2 Then '湿度
            _UnitMsg = "%"
        End If
        _cleft = 0
        _cTop = 0
        _cWidth = 0
        _cHeight = 0
    End Sub

    Public Sub New(ByVal diopti As DiDoPortTypeItem, ByVal imageid As String, ByVal TitleMsg As String, ByVal TipMsg As String)

        MyClass.New()

        _ProjectID = diopti.ProjectID
        _Netid = diopti.NetId
        _Refid = diopti.RefId

        If TitleMsg.IndexOf("冷库报警") <> -1 Then
            _PortNo = 1
        ElseIf TitleMsg.IndexOf("声光报警") <> -1 Then
            _PortNo = 2
        ElseIf TitleMsg.IndexOf("缺项报警") <> -1 Then
            _PortNo = 3
        ElseIf TitleMsg.IndexOf("库门报警") <> -1 Then
            _PortNo = 4
        End If

        _ImageID = imageid
        _DataType = 3  '报警类型
        If _PortNo = 1 Then
            _TitleMsg = TipMsg & "报警:"
        Else
            _TitleMsg = TitleMsg & ":"
        End If
        _TipMsg = TipMsg
        _UnitMsg = ""
        _cleft = 0
        _cTop = 0
        _cWidth = 0
        _cHeight = 0

    End Sub



    Private _ProjectID As String
    Public Property ProjectID() As String
        Get
            Return _ProjectID
        End Get
        Set(ByVal value As String)
            _ProjectID = value
        End Set
    End Property

    Private _Netid As Integer
    Public Property Netid() As Integer
        Get
            Return _Netid
        End Get
        Set(ByVal value As Integer)
            _Netid = value
        End Set
    End Property

    Private _Refid As Integer
    Public Property Refid() As Integer
        Get
            Return _Refid
        End Get
        Set(ByVal value As Integer)
            _Refid = value
        End Set
    End Property


    Private _PortNo As Integer
    Public Property PortNo() As Integer
        Get
            Return _PortNo
        End Get
        Set(ByVal value As Integer)
            _PortNo = value
        End Set
    End Property

    Private _ImageID As String
    Public Property ImageID() As String
        Get
            Return _ImageID
        End Get
        Set(ByVal value As String)
            _ImageID = value
        End Set
    End Property

    Private _DataType As Integer '端口配置类型(1: 温度; 2:湿度; 3:报警 )
    Public Property DataType() As Integer
        Get
            Return _DataType
        End Get
        Set(ByVal value As Integer)
            _DataType = value
        End Set
    End Property

    Private _TitleMsg As String
    Public Property TitleMsg() As String
        Get
            Return _TitleMsg
        End Get
        Set(ByVal value As String)
            _TitleMsg = value
        End Set
    End Property

    Private _TipMsg As String
    Public Property TipMsg() As String
        Get
            Return _TipMsg
        End Get
        Set(ByVal value As String)
            _TipMsg = value
        End Set
    End Property

    Private _UnitMsg As String
    Public Property UnitMsg() As String
        Get
            Return _UnitMsg
        End Get
        Set(ByVal value As String)
            _UnitMsg = value
        End Set
    End Property


    Private _cleft As Integer
    Public Property cLeft() As Integer
        Get
            Return _cleft
        End Get
        Set(ByVal value As Integer)
            _cleft = value
        End Set
    End Property


    Private _cTop As Integer
    Public Property cTop() As Integer
        Get
            Return _cTop
        End Get
        Set(ByVal value As Integer)
            _cTop = value
        End Set
    End Property

    Private _cWidth As Integer
    Public Property cWidth() As Integer
        Get
            Return _cWidth
        End Get
        Set(ByVal value As Integer)
            _cWidth = value
        End Set
    End Property


    Private _cHeight As Integer
    Public Property cHeight() As Integer
        Get
            Return _cHeight
        End Get
        Set(ByVal value As Integer)
            _cHeight = value
        End Set
    End Property

End Class
